import React from 'react'
import { useHistory } from 'react-router-dom'
import { FinancialFromMap } from '../../../../../../assets/enum'
import { Modal, Row, Col, Button } from 'antd'

const FoundFrom = ({ foundFromVisible, setFoundFromVisible }) => {
    const history = useHistory()
    const handleCancel = () => {
        setFoundFromVisible(false);
    };
    const handleEnterApplyPage = (value) => {
        history.push({
            pathname: '/financialApplyForm', state: {
                financialApplyType: value
            }
        })

    }
    return <Modal title="申请单类型" visible={foundFromVisible} onCancel={handleCancel} footer={null}>
        <Row gutter={[16, 24]}>
            {
                FinancialFromMap.map(item => <Col span={8} key={item.value}>
                    <Button type="primary" onClick={() => handleEnterApplyPage(item.value)} >{item.babel}</Button>
                </Col>)
            }
        </Row>
    </Modal>
}

export default FoundFrom